/*
 * @lc app=leetcode.cn id=1869 lang=typescript
 *
 * [1869] 哪种连续子字符串更长
 */

// @lc code=start
function checkZeroOnes(s: string): boolean {
    let max_zero = 0;
    let max_one = 0;
    let zero = 0;
    let one = 0;
    for (let i = 0; i < s.length; i++) {
        const element = s[i];
        if (element === "1") {
            one++;
            zero = 0;
            max_one = Math.max(one, max_one);
        } else {
            zero++;
            one = 0;
            max_zero = Math.max(zero, max_zero);
        }
    }
    return max_one > max_zero;
}
// @lc code=end
